package com.ddd.core.constants;

import com.ddd.core.constants.CommonConstants;
import org.springframework.util.ObjectUtils;

/**
 * @description:
 * @author: zhongwenbin
 * @date: 2024-10-22 11:34
 **/
public interface EncryptorConstants {

    String STRING_ENCRYPTOR_BEAN_NAME = "jasyptStringEncryptor";

    String ENCRYPTABLE_PROPERTY_DETECTOR_BEAN_NAME = "encryptablePropertyDetector";

    // 密钥
    String DEFAULT_JASYPT_ENCRYPTOR_PASSWORD = ObjectUtils.isEmpty(System.getenv("ASYPT_ENCRYPTOR_PASSWORD")) ?
            CommonConstants.GENERAL_PROJECT_PASSWORD : System.getenv("ASYPT_ENCRYPTOR_PASSWORD");
    // 加密算法
    String DEFAULT_JASYPT_ENCRYPTOR_ALGORITHM = "PBEWithMD5AndDES";

    // 加密前缀
    String DEFAULT_JASYPT_PREFIX = "ENC(";

    // 加密后后缀
    String DEFAULT_JASYPT_SUFFIX = ")";

}

